/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.util.Iterator;
import java.util.List;
import persistence.rb_employees_persist;
import vo.rb_employee;
import java.lang.Object;
import persistence.rb_emp_sal_structure_persist;

/**
 *
 * @author subin
 */
public class EmployeeController {
    
    public static EmployeeController getInstance() {
        
        return new EmployeeController();
    }
    
     public boolean create(rb_employee employee){
        new rb_employees_persist().insertEmployee(employee);
        return true;
    }
    
    public rb_employee update(rb_employee employee){
        
        return null;
    }
    
    public List fetchAll(){
        List list =  rb_employees_persist.getInstance().getForPopulatingEmployeeTable();
        return list;        
/*
        Object[] obj =  new Object[list.size()];
        Iterator it = list.iterator();
        int i=0;
        while(it.hasNext()) {
            
            rb_employee emp = (rb_employee)it.next();
            obj[i] = emp;
        }
        
        return obj;*/
    }
    
    public List getAllEmpSalaryDetails() {
        
        return new rb_emp_sal_structure_persist().getAllEmployeeSAlary();
    }
    public String delete(rb_employee employee){
        
        return null;
    }
    
     public rb_employee fetch(String employeeId){
        
        return null;
    }
    
   
}
